package com.zhongxi.guoyuan.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by Administrator on 2016/11/21.
 */

public class PagerAdapter extends FragmentPagerAdapter {
    private List<Fragment> list_fragments;
    public void setList_fragments(List<Fragment> list_fragments) {
        this.list_fragments = list_fragments;
    }

    public PagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return list_fragments.get(position);
    }

    @Override
    public int getCount() {
        return list_fragments != null ? list_fragments.size() : 0;
    }
}